home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Subject: Re: HP UX 10.0 C programm
- X-Nntp-Posting-Host: golden.ripco.com
- Message-ID: <DKovAp.G37@rci.ripco.com>
- Sender: usenet@rci.ripco.com (Net News Admin)
- Organization: Ripco Internet BBS Chicago
- Date: Fri, 5 Jan 1996 03:35:13 GMT
- X-Ident-Sender: mambuhl
-
- "Chad R. Laity" <wick@pop.fast.net>
- in <4cfje3$qk@nn.fast.net> asks:
-
- >2 questions: (1) What is a good book for HP UX 10.0 C programming?
-
- Don't know.
-
- > (2) Why do I get an error on this cut down program listed
- > below when I compile it on an HP 9000 K200 with HP UX 10.0
-
- [errors moved to here]
- >cc: "test.c", line 15: error 1588: "buf" undefined.
- >cc: "test.c", line 15: warning 563: Argument #2 is not the correct type.
-
- Because you never defined buf. You can't expect a more informative
- error message than the one you got.
-
- Fix it with a declaration
- struct stat buf;
-
- BTW, if sys/stat.h contains a prototype for stat(), there's no reason
- for you to include one.
-
- > and I do not get an error with our Intergraph server?
-
- If you do not get an error, there are two possibilities:
- 1) This isn't the code being compiled - or -
- 2) The compiler is doing seriously wrong stuff. If it creates a
- variable "struct stat buf" behind your back, what else might it do?
-
- > (basically I just want to get the file size of a file but
- > this buf problem is giving me a head ache)
- >----------------------- program ---------------------------------
-
- >#include <stdio.h>
- >#include <sys/stat.h>
-
- >main()
- >{
- >int i;
- >int stat(const char *path, struct stat *buf);
-
- >i = stat("/usr2/test/testfile", &buf); /* line 15 */
-
- >}
-
- >------------------------ error -----------------------------------
- >Compiled using: cc -Aa test.c
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-